{extend name="index/index"}
{block name="mycss"}
    <link href="/static/index/css/pic.css" rel="stylesheet">
    <link href="/static/index/css/pic1.css" rel="stylesheet">
    <link href="/static/index/css/style.css" rel="stylesheet" type="text/css" media="all"/>
    <style>
    </style>
{/block}

{block name="fjs"}
    <script type="text/javascript">
        var now = new Date();
        var beginTime = now.getTime();
        var b = 1;
        var stime = "1534990869";
        setInterval(function () {
            stime++;
        }, 1000);
    </script>
{/block}
{block name="main"}
    <div style="background-color: red;"></div>
{/block}
{block name="main1"}
<div class="box-topic" data-lkid="15">

    <!--分类-->
    <div class="container" style="border:1px solid #ccc;background-color: #fff;" >
        <div class="clearfix" style="width: 1300px;margin-top:20px;margin-bottom:20px" >

            <div class="" style="width:1100px"><em class="text-orange">所在分类:</em><a href="{:url('index/index/cate1')}"  style="border-radius:20px;color:#fff;width:70px;height:30px;line-height:10px;margin-left:10px;background-color: #10C55B;" class="btn  btn-xs" >全部</a>
                {volist name="cate" id="vv"}
                <a href="{:url('index/index/cate1',['id'=>$vv['id'],'pid'=>$vv['pid']])}" style="text-decoration:none">
                    <span style="margin-left:10px;border:1px dashed red;">{$vv['name']}</span>
                </a>
                {/volist}
            </div>

            {if condition="($cate1)"}
            <div class="" style="margin-top:20px;width:1100px">
                <hr align="center" width="700px" style= "border:1px dashed #ccc" />

                <em class="text-orange">所在分类:</em><span style="padding:0 0 0 80px"></span>
                {volist name="cate1" id="val"}
                <a href="{:url('index/index/cate1',['id'=>$val['id'],'pid'=>$val['pid']])}" style="text-decoration:none">
                    <span style="margin-left:10px;border:1px dashed red;">{$val['name']}</span>
                </a>
                {/volist}
                {else/}
                {/if}
            </div>

            {if condition="($cate2)"}
            <div class=""  style="margin-top:20px;width:1100px">
                <hr align="center" width="700px" style= "border:1px dashed #ccc" />
<em class="text-orange">所在分类:</em><span style="padding:0 0 0 80px"></span>
                {volist name="cate2" id="vvvv"}
                <a href="{:url('index/index/cate1',['id'=>$vvvv['id'],'pid'=>$vvvv['pid']])}" style="text-decoration:none">
                    <span style="margin-left:10px;border:1px dashed red;">{$vvvv['name']}</span>
                </a>
                {/volist}
                {else/}
                {/if}
            </div>
        </div>
    </div>
    <!--END分类-->


    <div class="w1200" style="margin-top:20px">

        <div class="topic-wrap h-lg roll-box " id="NO08758">
            <div class="roll-wrap">
                <div class="clearfix" style="width: 1300px;">




                <!--首页遍历-->
                {volist name="data" id="v" key="k"}
                <div class="qt-card-primary wrap-list roll-list fl">
                    <div class="card-img">
                        <a href="{:url('index/details/newpic',['id'=>$v['id']])}" target="_blank"
                           class="clickL avatar" data-id="15-0-0">
                            <div class="card-trait">
                                <div class="card-tag-business "></div>
                            </div>
                            <img class="" src="http://pdyc9epam.bkt.clouddn.com/{$v['icon']}?imageMogr2/thumbnail/540x720>/gravity/North/crop/270x360/format/jpg/blur/1x0/quality/75|imageslim" alt="" width="270" height="360">
                            <div class="card-bg"></div>
                            <div class="card-handle">
                                <div class="handle-dum qt-btn btn-green-linear download-page" data-id="32218731" data-yc="1" data-bg="0">
                                    <span cass="glyphicon glyphicon-download-alt">VIP免费下载</span>
                                </div>
                                <div class="handle-fav bottom-fav-ajax"  data-action="addFav" style="font-size:20px">
                                    <div class="" style="margin-top: -5px;margin-left: 5px">
                                        <span class="glyphicon glyphicon-heart house-btn" data-id="{$v['id']}"></span>
                                    </div>
                                </div>
                            </div>
                        </a>
                    </div>
                    <div class="card-tag  isYC"></div>
                    <p class="card-title">{$v['desc']}</p><a href="" class="card-title card-intro" target="_blank">
                        <span class="glyphicon glyphicon-download-alt ">下载数量:{$v['sold']}</span> &nbsp;&nbsp;
                        <span class="glyphicon glyphicon-gift">收藏数量:{$v['house']}</span>
                    </a>
                </div>
                {/volist}
                <!--END图片遍历-->
            </div>
                {$page?=$page}
        </div>
    </div>
</div>
</div>
{/block}
{block name="myjs"}
    <script>
       $('.att-btn').click(function(){
           var fid=$(this).attr('data-id');
           attAjax(fid);
       })
       //执行关注和取消关注-->
       function attAjax(fid)
       {
           var fas = $('.fas-num').html();
           $.ajax({
               type:'post',
               dataType:'json',
               data:{'fid':fid},
               url:'/attention',
               success:function(data){
                   if(data.status){
                       toastr.success('关注成功');
                       $('.att-btn').html('取消关注');
                       $('.fas-num').html(parseInt(fas)+1);
                   }else{
                       toastr.success('取关成功');
                       $('.att-btn').html('点击关注');
                       $('.fas-num').html(parseInt(fas)-1);
                   }
               },
               error:function(){
                   toastr.error('网络错误,请重试');
               }
           })
       }
       $('.house-btn').click(function(){
           var gid =$(this).attr('data-id');
           houseAjax(gid);
           return false;
       })
       function houseAjax(gid)
       {
           $.ajax({
                type:'post',
                dataType:'json',
                data:{'gid':gid},
                url:'/house',
                success:function(data){
                    if(data.status){
                        alert(data.info);
                    }else{
                        alert(data.info);
                    }
                },
                error:function(){
                }
            })
        }
</script>
{/block}